package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {
    /**
     * 查找规格
     * @param categoryName
     * @return
     */
    @Select("select s.name,s.options from tb_spec s where s.template_id in(SELECT c.template_id from tb_category c WHERE c.`name`=#{categoryName} )")
    List<Map> findSpecByCategory(@Param("categoryName") String categoryName);

}
